<script>
	export default {
		onLaunch: function() {
			uni.login({
				provider: 'weixin',
				success: function(res) {
					console.log(res.code, "登录企业微信成功标志")
					if (res.code) {
						uni.request({
							url:'https://dd18-183-230-155-83.jp.ngrok.io/onLogin',
							method:"POST",
							header:{
								"Content-Type":"application/x-www-form-urlencoded"
							},
							data:{
								code:res.code,
								appid:"wx27d85a8ae2391578",
								appsecret:"b2ba0b963415bfe265527c9db6dc4472"
							},
							success: (res) => {
								console.log(res)
							}
						})
					} else {
						console.log('登录失败！' + res.errMsg)
						that.open()
					}
				}
			});
		},
		onShow: function() {
			console.log('App Show')
		},
		onHide: function() {
			console.log('App Hide')
		}
	}
</script>

<style>
	/*每个页面公共css */
</style>
